class Solution {
    static class ListNode {
        ListNode next;
        ListNode head;
    }
    public ListNode reverseList(ListNode head) {

        if(head == null || head.next == null) {
            return head;
        }

        ListNode cur = head.next;
        head.next = null;

        while(cur != null) {
            cur.next = head;
            head = cur;
            cur = cur.next;
        }
        return head;
    }
    public void addFirst(int data) {
        ListNode node = new ListNode(data);
        if(head == null) {
            head = node;
            last = node;
        }else {
            node.next = head;
            head = node;
        }
    }

    public static void main(String[] args) {
        ListNode listNode = new ListNode();
        listNode.
    }
}